﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ue.Infrastructure.DomainBase;
using Ue.Infrastructure.RepositoryFramework;

namespace Ue.Qcdz.Domain.Membership
{
    public class UserService
    {
        private static IUserRepository _repository;
        static UserService()
        {
            UserService._repository = RepositoryFactory.GetRepository<IUserRepository, User>();
        }
        public static User GetUser(object userKey)
        {
            return UserService._repository.FindBy(userKey);
        }
        public static IList<User> GetUser()
        {
            return UserService._repository.FindAll();
        }
        public static IDataResult<User> GetTags(IDataQuery dataQuery)
        {
            return UserService._repository.FindBy(dataQuery);
        }
        public static void AddUser(User user)
        {
            UserService._repository.Add(user);
        }
        public static void UpdateUser(User user)
        {
            UserService._repository[user.Key] = user;
        }
    }
}
